package collection.set;

import java.util.Iterator;
import java.util.List;
import java.util.TreeSet;

public class Test1 {
    public static void main(String[] args) {
        TreeSet<Integer> set = new TreeSet<>(List.of(1, 6, 2, 3, 5, 0));
        Iterator<Integer> iterator = set.iterator();

        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }

        for (Integer integer : set) {
            System.out.println(integer);
        }

        set.forEach(System.out::println);
    }
}
